#ifndef __TEMP_Detect_C
#define __TEMP_Detect_C

#include "TEMP_Detect.h"


void ADC_TEMP_Init(void){
		GPIO_Config_T   configStruct;
	
    /* Enable GPIOA clock */
    RCM_EnableAPB2PeriphClock(TEMP_RTC);
	  #ifdef TEMP2_RTC
	  RCM_EnableAPB2PeriphClock(TEMP2_RTC);
    #endif
	  #ifdef TEMP3_RTC
	  RCM_EnableAPB2PeriphClock(TEMP3_RTC);
    #endif
	  
    /* ADC channel 0 configuration */
    GPIO_ConfigStructInit(&configStruct);    
    configStruct.mode    = GPIO_MODE_ANALOG;  
    configStruct.speed   = GPIO_SPEED_50MHz;  
	  
	  // 温度传感器
	  configStruct.pin     = TEMP1_PinId; 
	  GPIO_Config(TEMP_PinPort, &configStruct);
	  
	  #ifdef TEMP2_PinPort
		configStruct.pin     = TEMP2_PinId; 
	  GPIO_Config(TEMP2_PinPort, &configStruct);		
		#endif
		
		#ifdef TEMP3_PinPort
		configStruct.pin     = TEMP3_PinId; 
	  GPIO_Config(TEMP3_PinPort, &configStruct);		
		#endif
}

#endif
